/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Interfaz;

import java.awt.*;

/**
 *
 * @author Duvan
 */
public class Administration extends javax.swing.JFrame {

    /**
     * Creates new form Administration
     */
    public Administration() {
        super("Administration");
        initComponents();
    }
    
    
    //Variables
    AddMovie newMovie;
    AddPerson newActor, newArtist, newDirector;
    AddSong newSong;
    Searching newEditMovie, newEditActor, newEditSong, newEditArtist, newEditDirector;
    RegistroAdmin newAdmin;
    
    //Boton AddMovie
    public void AddMovie(){
        newMovie = new AddMovie();
        newMovie.setVisible(true);
    }
    
    //Boton AddPerson
    public void AddActor(){
        newActor = new AddPerson();
        newActor.setVisible(true);
        newActor.setTipePerson("actor");
    }
    
    //Boton AddSong
    public void AddSong(){
        newSong = new AddSong();
        newSong.setVisible(true);
    }
    
    //Boton AddArtist
    public void AddArtist(){
        newArtist = new AddPerson();
        newArtist.setVisible(true);
        newArtist.setTipePerson("artist");
    }
    
    
    //Boton Edit Movie
    public void EditMovie(){
        newEditMovie = new Searching();
        newEditMovie.setVisible(true);
        newEditMovie.setTipeToEdit("movie");
    }
    
    //Boton Edit Actor
    public void EditActor(){
        newEditActor = new Searching();
        newEditActor.setVisible(true);
        newEditActor.setTipeToEdit("actor");
    }
    
    //Boton Edit Song
    public void EditSong(){
        newEditSong = new Searching();
        newEditSong.setVisible(true);
        newEditSong.setTipeToEdit("song");
    }
    
    //Boton Edit Artist
    public void EditArtist(){
        newEditArtist = new Searching();
        newEditArtist.setVisible(true);
        newEditArtist.setTipeToEdit("artist");
    }
    
    //Boton Edit Director
    public void EditDirector(){
        newEditDirector = new Searching();
        newEditDirector.setVisible(true);
        newEditDirector.setTipeToEdit("director");
    }
    
    //Boton New Admin
    public void AddAdmin(){
        newAdmin = new RegistroAdmin();
        newAdmin.setVisible(true);
    }
    
    //Boton Add Director
    public void AddDirector(){
        newDirector = new AddPerson();
        newDirector.setVisible(true);
        newDirector.setTipePerson("director");
    }
    
    
   
    
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        AddMovie = new javax.swing.JButton();
        EditMovie = new javax.swing.JButton();
        Exit = new javax.swing.JButton();
        NewAdmin = new javax.swing.JButton();
        AddActor = new javax.swing.JButton();
        EditActor = new javax.swing.JButton();
        AddSong = new javax.swing.JButton();
        EditSong = new javax.swing.JButton();
        AddArtist = new javax.swing.JButton();
        EditArtist = new javax.swing.JButton();
        AddDirector = new javax.swing.JButton();
        EditDirector = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setResizable(false);

        jLabel1.setText("Welcome to the Administration Window");

        AddMovie.setText("Add Movie");
        AddMovie.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                AddMovieActionPerformed(evt);
            }
        });

        EditMovie.setText("Edit Movie");
        EditMovie.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                EditMovieActionPerformed(evt);
            }
        });

        Exit.setText("Exit");
        Exit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ExitActionPerformed(evt);
            }
        });

        NewAdmin.setText("New Admin");
        NewAdmin.setActionCommand("NewAdmin");
        NewAdmin.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                NewAdminActionPerformed(evt);
            }
        });

        AddActor.setText("Add Actor");
        AddActor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                AddActorActionPerformed(evt);
            }
        });

        EditActor.setText("Edit Actor");
        EditActor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                EditActorActionPerformed(evt);
            }
        });

        AddSong.setText("Add Song");
        AddSong.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                AddSongActionPerformed(evt);
            }
        });

        EditSong.setText("Edit Song");
        EditSong.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                EditSongActionPerformed(evt);
            }
        });

        AddArtist.setText("Add Artist");
        AddArtist.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                AddArtistActionPerformed(evt);
            }
        });

        EditArtist.setText("Edit Artist");
        EditArtist.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                EditArtistActionPerformed(evt);
            }
        });

        AddDirector.setText("Add Director");
        AddDirector.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                AddDirectorActionPerformed(evt);
            }
        });

        EditDirector.setText("Edit Director");
        EditDirector.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                EditDirectorActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(46, 46, 46)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel1)
                    .addComponent(AddDirector)
                    .addComponent(AddArtist)
                    .addComponent(AddSong)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(AddMovie)
                            .addComponent(AddActor)
                            .addComponent(NewAdmin))
                        .addGap(35, 35, 35)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(Exit)
                            .addComponent(EditActor)
                            .addComponent(EditMovie)
                            .addComponent(EditSong)
                            .addComponent(EditArtist)
                            .addComponent(EditDirector))))
                .addGap(46, 74, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(42, 42, 42)
                .addComponent(jLabel1)
                .addGap(32, 32, 32)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(AddMovie)
                    .addComponent(EditMovie))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(AddActor)
                    .addComponent(EditActor))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(AddSong)
                    .addComponent(EditSong))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(AddArtist)
                    .addComponent(EditArtist))
                .addGap(14, 14, 14)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(AddDirector)
                    .addComponent(EditDirector))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(NewAdmin)
                    .addComponent(Exit))
                .addContainerGap(71, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void AddMovieActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AddMovieActionPerformed
        AddMovie();
    }//GEN-LAST:event_AddMovieActionPerformed

    private void EditMovieActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_EditMovieActionPerformed
        EditMovie();
    }//GEN-LAST:event_EditMovieActionPerformed

    private void ExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ExitActionPerformed
        Administration.this.dispose();
    }//GEN-LAST:event_ExitActionPerformed

    private void NewAdminActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_NewAdminActionPerformed
        AddAdmin();
    }//GEN-LAST:event_NewAdminActionPerformed

    private void AddActorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AddActorActionPerformed
        AddActor();
    }//GEN-LAST:event_AddActorActionPerformed

    private void EditActorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_EditActorActionPerformed
        EditActor();
    }//GEN-LAST:event_EditActorActionPerformed

    private void EditSongActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_EditSongActionPerformed
        EditSong();
    }//GEN-LAST:event_EditSongActionPerformed

    private void EditArtistActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_EditArtistActionPerformed
        EditArtist();
    }//GEN-LAST:event_EditArtistActionPerformed

    private void AddSongActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AddSongActionPerformed
        AddSong();
    }//GEN-LAST:event_AddSongActionPerformed

    private void AddArtistActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AddArtistActionPerformed
        AddArtist();
    }//GEN-LAST:event_AddArtistActionPerformed

    private void AddDirectorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_AddDirectorActionPerformed
        AddDirector();
    }//GEN-LAST:event_AddDirectorActionPerformed

    private void EditDirectorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_EditDirectorActionPerformed
        EditDirector();
    }//GEN-LAST:event_EditDirectorActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Administration.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Administration.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Administration.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Administration.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create and display the form
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new Administration().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton AddActor;
    private javax.swing.JButton AddArtist;
    private javax.swing.JButton AddDirector;
    private javax.swing.JButton AddMovie;
    private javax.swing.JButton AddSong;
    private javax.swing.JButton EditActor;
    private javax.swing.JButton EditArtist;
    private javax.swing.JButton EditDirector;
    private javax.swing.JButton EditMovie;
    private javax.swing.JButton EditSong;
    private javax.swing.JButton Exit;
    private javax.swing.JButton NewAdmin;
    private javax.swing.JLabel jLabel1;
    // End of variables declaration//GEN-END:variables
}
